import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
  GetProcurementInfo = '/oauth/login-with-token',
  MenuPermission = '/system/user/menuPermission',
}

// 获取采购信息列表
export function checkToken(params: any, mode: ErrorMessageMode = 'message') {
  return defHttp.post(
    { url: Api.GetProcurementInfo, params },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 获取用户角色权限
 */
export function getMenuPermission(userId: string, mode: ErrorMessageMode = 'message') {
  return defHttp.get(
    {
      url: Api.MenuPermission,
      params: { userId },
    },
    {
      errorMessageMode: mode,
    },
  );
}
